package com.gy.api.mobile.app;

import com.github.pagehelper.PageInfo;
import com.gy.api.base.ApiIndex;
import com.gy.api.base.R;
import com.gy.api.base.RestPage;
import com.gy.api.pc.movie.domain.vo.FilmPermitInfoSearchVO;
import com.gy.api.pc.movie.domain.vo.FilmPermitInfoVO;
import com.gy.api.pc.movie.service.IFilmPermitInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api( tags = ApiIndex.H5_IndexController)
@RestController
@RequestMapping("/app/system/permitInfo")
public class AppFilmPermitInfoController {


    @Autowired
    private IFilmPermitInfoService filmPermitInfoService;

    @ApiOperation("查询公映许可证信息-公示列表")
    @GetMapping("/list")
    public R<RestPage<FilmPermitInfoVO>> list(@ModelAttribute FilmPermitInfoSearchVO searchVO){
        List<FilmPermitInfoVO> list = filmPermitInfoService.getList(searchVO);
        RestPage restPage = new RestPage( new PageInfo(list),list);
        return new R(restPage);
    }


    @ApiOperation("根据ID获取公映许可证信息-公示详请")
    @GetMapping(value = "/{id}")
    public R<FilmPermitInfoVO> getInfo(@ApiParam(value = "公映许可证ID") @PathVariable("id") String id)
    {
        FilmPermitInfoVO filmPermitInfoVO=filmPermitInfoService.getOne(id);
        return new R(filmPermitInfoVO);
    }


}
